<?php
declare (strict_types = 1);

namespace app\admin\controller\databases;

use app\common\controller\AdminController;
use extend\database\Database as dbdatabase;
// use app\admin\model\system\Database as DatabaseModel;
use think\facade\Db;
class Database extends AdminController
{
   public function index(){
      
      $aa= exec('php -v');
      dd($aa);
      $table = Db::query("SHOW TABLE STATUS");
      // 获取当前时间作为备份文件名的后缀
      $time = date('YmdHis');

      try {
         // 调用Db类的backup()静态方法进行数据库备份
         Db::backup($time);

         echo "数据库备份成功！";
      } catch (\Exception $e) {
         echo "数据库备份失败：" . $e->getMessage();
      }
      // return view();
   }
}
